<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Array 3</title>
</head>
<body>
    <!-- 点击后反转数组的排序（从正序反转为倒序） -->
    <button onclick="reverseArray()">反转数组排序</button>
    <p id="arrayOutput"></p>
</body>
</html>
    <script>
        const arr1 = [1,3,2,6,5,33];
        document.getElementById('arrayOutput').innerHTML = '原有数组:'+arr1
       function reverseArray() {
        console.log(arr1);
        const arr2 = arr1.reverse();
        console.log(arr2);
        document.getElementById('arrayOutput').innerHTML = arr2
       }
    </script>